<!--
 * @Description: 
 * @Author: HYH
 * @LastEditors: HYH
 * @LastEditTime: 2023-06-16 21:29:04
-->
<template>
  <div class="flex-1 m-6 p-6 mx-0 mr-6 bg-stone-200 rounded-sm overflow-auto">
    <ul class="menu bg-base-200 my-8 rounded-box" v-for="(item, key) in data" :key="key">
      <li>
        <h2 class=" pointer-events-none cursor-pointer text-xl ml-3 mt-2 !font-bold">
          {{ key.toString().slice(5) }} {{ item[0].classDes }}
        </h2>
      <li v-for="(content, index) in item" :key="index" class=" items-start">
        <div class="hover:bg-transparent">
          <span> {{ content.url }}</span>
          <span class="font-bold text-base uppercase" :class="{
            'text-red-700': content.method === 'delete',
            'text-orange-500': content.method === 'post',
            'text-green-500': content.method === 'get',
            'text-blue-600': content.method === 'put',
          }">
            {{ content.method }}
          </span>
          <span class="ml-4 text-gray-600 ">{{ content.description }}</span>
        </div>
      </li>
      </li>
    </ul>
  </div>
</template>
<script setup lang="ts">
import { http } from '@/http'
const activeTab = ref('')
const data = ref()

interface IDate {
  url: string
  method: 'get' | 'post' | 'put' | 'delete' | "patch"
  /**描述 */
  description?: string
  prefix: string

}
onMounted(() => {
  http.post<IDate[]>('/api/apis').then(res => {
    data.value = res.data
    console.log(`data.value ==>`, data.value);
  })
})
</script>
